require "ttWxCommon"
require "ttWxTextEditorMgr"

class MainFrameWorkFrameMgr < AuiNotebook
	def initialize(frm,auiMgr)
		@frm=frm
		@auiMgr=auiMgr
		@notebook_style=AUI_NB_DEFAULT_STYLE
		super(@frm,ID_ANY,DEFAULT_POSITION,DEFAULT_SIZE,@notebook_style)
		@pi = AuiPaneInfo.new
		@pi.set_name("ProjectTextEditor")
		@pi.show.set_layer(0)
		@pi.center_pane.show
		@auiMgr.add_pane(self, @pi)
########################## evt
		evt_auinotebook_page_close self,:on_notebook_page_close
	end
	def openFile(elem)
		TTTextEditor.new(self,elem,"open")
	end
	def createNewFile(elem)
		TTTextEditor.new(self,elem,"new")
	end
	def showFiles(elem)
	end
########################## evt
	def on_notebook_page_close(event)
		index = event.get_selection
		notebook = event.get_event_object
		page = notebook.get_page(index)
		page.close()
	end
end
